Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: More Macintosh Toolbox

Previous | Chapter Top | Chapter Contents | Next |

Setting Component Errors

The Component Manager maintains error state information for all currently active components. In general, your component returns error information in its function result; a nonzero function result indicates an error occurred, and a function result of 0 indicates the request was successful. However, some requests require that your component return other information as its function result. In these cases, your component can use the SetComponentInstanceError procedure to report its latest error state to the Component Manager. You can also use this procedure at any time during your component's execution to report an error

SetComponentInstanceError

Although your component usually returns error information as its function result, your component can choose to use the SetComponentInstanceError procedure to pass error information to the Component Manager. The Component Manager uses this error information to set the current error value for the appropriate connection. Applications can then retrieve this error information by calling the GetComponentInstanceError function. The documentation for your component should specify how the component indicates errors.

PROCEDURE SetComponentInstanceError
                                         (aComponentInstance: ComponentInstance; theError: OSErr);
aComponentInstance
A component instance that specifes the connection for which to set the error. The Component Manager provides a component instance to your component when the connection is opened. The Component Manager also provides a component instance to your component as the first parameter in the params field of the parameters record.
theError
The new value for the current error. The Component Manager uses this value to set the current error for the connection specified by the aComponentInstance parameter.

DESCRIPTION

The SetComponentInstanceError procedure sets the error associated with the specified component instance to the value specified by the parameter theError .

SEE ALSO

For a description of the GetComponentInstanceError function, see GetComponentInstanceError .


© 1999 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next